Replaces the HTML inside the <body> tag of the document.
#include <IE.au3>
_IEBodyWriteHTML ( ByRef $o_object, $s_html )
Parameters
$o_object | Object variable of an InternetExplorer.Application, Window or Frame object |
$s_html | The HTML string to write to the document |
Return Value
Success: | Returns -1 |
Failure: | Returns 0 and sets @ERROR |
@Error: | 0 ($_IEStatus_Success) = No Error |
1 ($_IEStatus_GeneralError) = General Error | |
3 ($_IEStatus_InvalidDataType) = Invalid Data Type | |
4 ($_IEStatus_InvalidObjectType) = Invalid Object Type | |
6 ($_IEStatus_LoadWaitTimeout) = Load Wait Timeout | |
8 ($_IEStatus_AccessIsDenied) = Access Is Denied | |
9 ($_IEStatus_ClientDisconnected) = Client Disconnected | |
@Extended: | Contains invalid parameter number |
Remarks
You may use _IEBodyReadHTML to read the current HTML contents of the document body, manipulat that string and then write it back with _IEBodyWriteHTML. You may also use _IEDocInsertHTML, _IEDocInsertText and the innerHTML, innerText, outerHTML and outerText features of _IEPropertyGet and _IEPropertySet to control specific elements without rewriting large blocks of text.
Related
_IEBodyReadHTML, _IEBodyReadText, _IEDocInsertHTML, _IEDocInsertText, _IEPropertyGet, _IEPropertySet
Example
; *******************************************************
; Example 1 - Open a browser with the iFrame example, get a reference
; to the iFrame with a name of "iFrameTwo" and replace its body HTML
; *******************************************************
;
#include <IE.au3>
$oIE = _IE_Example ("iframe")
$oFrame = _IEFrameGetObjByName ($oIE, "iFrameTwo")
_IEBodyWriteHTML ($oFrame, "Hello <b>iFrame!</b>")